luci-app-banip: sync with update 1.5.6-4
authorDirk Brenken <[email protected]>
Mon, 9 Jun 2025 05:04:15 +0000 (07:04 +0200)
committerDirk Brenken <[email protected]>
Mon, 9 Jun 2025 05:04:32 +0000 (07:04 +0200)
Signed-off-by: Dirk Brenken <[email protected]>
applications/luci-app-banip/htdocs/luci-static/resources/view/banip/map.html
applications/luci-app-banip/htdocs/luci-static/resources/view/banip/setreport.js
applications/luci-app-banip/root/usr/share/rpcd/acl.d/luci-app-banip.json

index a125325aefb96756b0ff4c0e0a6145854bae1094..0c0537b284dc2501a819bc674afb853dccb8801b 100644 (file)
@@ -33,7 +33,7 @@
 
                /* intialize map */
                let map = L.map('map', {
-                       zoom: 4,
+                       zoom: 3,
                        minZoom: 2,
                        maxZoom: 18,
                        center: [50, 10]
index a7c9c5d33d3792771f894fff06529db8fe212ca6..27067cf138c8182de192269adc678bf40fbaec41 100644 (file)
@@ -92,6 +92,18 @@ function handleAction(report, ev) {
                                        )
                                ]),
                        ]),
+                       E('div', { 'class': 'left', 'style': 'display:flex; flex-direction:column' }, [
+                               E('label', { 'class': 'cbi-checkbox', 'style': 'padding-top:.5em' }, [
+                                       E('input', {
+                                               'class': 'cbi-checkbox',
+                                               'data-update': 'click change',
+                                               'type': 'checkbox',
+                                               'id': 'filter',
+                                               'value': 'true'
+                                       }),
+                                       E('span', { 'style': 'margin-left: .5em;' }, _('Show only Set elements with hits'))
+                               ]),
+                       ]),
                        E('div', { 'class': 'left', 'style': 'display:flex; flex-direction:column' }, [
                                '\xa0',
                                E('h5', _('Result')),
@@ -112,10 +124,12 @@ function handleAction(report, ev) {
                                E('button', {
                                        'class': 'btn cbi-button-action',
                                        'click': ui.createHandlerFn(this, function (ev) {
+                                               const checkbox = document.getElementById('filter');
+                                               const isChecked = checkbox.checked;
                                                let set = document.getElementById('set').value;
                                                if (set) {
                                                        document.getElementById('result').textContent = 'Collecting Set content, please wait...';
-                                                       return L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['content', set])).then(function (res) {
+                                                       return L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['content', set, isChecked])).then(function (res) {
                                                                let result = document.getElementById('result');
                                                                result.textContent = res.trim();
                                                                document.getElementById('set').value = '';
@@ -191,7 +205,7 @@ return view.extend({
                                E('th', { 'class': 'th' }, _('Inbound&#160;(packets)')),
                                E('th', { 'class': 'th' }, _('Outbound&#160;(packets)')),
                                E('th', { 'class': 'th' }, _('Port&#160;/&#160;Protocol')),
-                               E('th', { 'class': 'th' }, _('Elements'))
+                               E('th', { 'class': 'th' }, _('Elements (max. 50)'))
                        ])
                ]);
 
index 57332394d79814a38ba1d0e456d62df6fa7547f1..ffff57aeea18e8c7efaf651488449793dbc0586f 100644 (file)
@@ -63,7 +63,7 @@
                                "/etc/init.d/banip search [A-Za-z0-9:.]*": [
                                        "exec"
                                ],
-                               "/etc/init.d/banip content [A-Za-z0-9]*": [
+                               "/etc/init.d/banip content [A-Za-z0-9]* *": [
                                        "exec"
                                ],
                                "/etc/init.d/banip status": [